import QtQuick 2.0

Item {
    id: line
    objectName: "running_line"
    property alias speed: timer.interval
    property alias text: textLine.text
    property alias color: textLine.color
    property alias size: textLine.font.pointSize
    property alias font: textLine.font.family
    property alias running: timer.running
    property int step: 3
    clip: true

    Text {
        id: textLine
        color: "white"
        anchors.verticalCenter: parent.verticalCenter
        font.pointSize: 58
    }

    Timer {
        id: timer
        interval: 30
        running: false
        repeat: true
        onTriggered: {
            var x = textLine.x
            x -= line.step
            if (x < 0 && Math.abs(x) >= textLine.width)
                x = line.width
            textLine.x = x
        }
    }
}
